package com.gpframework.module.wages.domain.req;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gpframework.common.utils.StringUtils;
import com.gpframework.module.base.domain.req.BaseReq;
import com.gpframework.module.wages.domain.GzHolidays;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @ClassName GzHolidaysReq
 * @Author gpframework
 * @Date 2024-04-24
 * @Version 1.0.0
 * @Description 列表查询信息体
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
public class GzHolidaysReq extends BaseReq {
    private static final long serialVersionUID = 1L;

         @ApiModelProperty("月份")
     private Date month;
     @ApiModelProperty("广州基本工资")
     private String basicSalaryGuangzhou;
     @ApiModelProperty("法定节假日")
     private String legalHolidays;
     @ApiModelProperty("周末假期天数")
     private String weekendHolidayDays;
     @ApiModelProperty("每月天数")
     private String daysPerMonth;
     @ApiModelProperty("工作日")
     private String weekday;
     @ApiModelProperty("计薪日")
     private String salaryCalculationDay;
     @ApiModelProperty("出勤天数比例")
     private String attendanceDaysRatio;
     @ApiModelProperty("出勤工资")
     private String attendanceSalary;
     @ApiModelProperty("国家节假日带薪工资")
     private String paidsalaryDuringNationalHolidays;
     @ApiModelProperty("备注")
     private String remarks;
     @ApiModelProperty("排序")
     private Long sort;

    /**
    * @Description 生成查询wrapper
    * @Author greatplan@qq.com
    * @Date 2020-11-04 16:04
    * @Param [lqw]
    * @Param [isVO] 是否vo查询体，true的话走的是mapper.xml里面的查询语句，不过查询语法还是mybatis-plus，主要用于某些关联查询出一些非数据表字段
    * @Return void
    */
    public void generatorQuery(QueryWrapper<GzHolidays> lqw,boolean isVo) {
        String alias = "";
        if (isVo) {
            alias = "gp.";
            lqw.eq(alias+"del_status",0);
        }
        if (this.getMonth() != null){
        lqw.eq(alias+"month" ,this.getMonth());
        }
        if (StringUtils.isNotBlank(this.getBasicSalaryGuangzhou())){
        lqw.eq(alias+"basic_salary_guangzhou" ,this.getBasicSalaryGuangzhou());
        }
        if (StringUtils.isNotBlank(this.getLegalHolidays())){
        lqw.eq(alias+"legal_holidays" ,this.getLegalHolidays());
        }
        if (StringUtils.isNotBlank(this.getWeekendHolidayDays())){
        lqw.eq(alias+"weekend_holiday_days" ,this.getWeekendHolidayDays());
        }
        if (StringUtils.isNotBlank(this.getDaysPerMonth())){
        lqw.eq(alias+"days_per_month" ,this.getDaysPerMonth());
        }
        if (StringUtils.isNotBlank(this.getWeekday())){
        lqw.eq(alias+"weekday" ,this.getWeekday());
        }
        if (StringUtils.isNotBlank(this.getSalaryCalculationDay())){
        lqw.eq(alias+"salary_calculation_day" ,this.getSalaryCalculationDay());
        }
        if (StringUtils.isNotBlank(this.getAttendanceDaysRatio())){
        lqw.eq(alias+"attendance_days_ratio" ,this.getAttendanceDaysRatio());
        }
        if (StringUtils.isNotBlank(this.getAttendanceSalary())){
        lqw.eq(alias+"attendance_salary" ,this.getAttendanceSalary());
        }
        if (StringUtils.isNotBlank(this.getPaidsalaryDuringNationalHolidays())){
        lqw.eq(alias+"paidsalary_during_national_holidays" ,this.getPaidsalaryDuringNationalHolidays());
        }
        if (StringUtils.isNotBlank(this.getRemarks())){
        lqw.eq(alias+"remarks" ,this.getRemarks());
        }
        if (this.getSort() != null){
        lqw.eq(alias+"sort" ,this.getSort());
        }
    }
}
